package io.github.iogogogo.commons.util;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Created by tao.zeng on 2025/3/21.
 */
public class FileUtils {

    public static void writeString(String filepath, String content) throws IOException {
        writeString(filepath, content, true);
    }

    public static void writeString(String filepath, String content, boolean append) throws IOException {
        try (FileWriter fileWriter = new FileWriter(filepath, append);
             BufferedWriter bw = new BufferedWriter(fileWriter)) {
            bw.write(content + System.lineSeparator());
        }
    }
}
